Variable declarators for Crystal syntax
Variable declarators let you define a variable by giving the variable a name. Optionally, you can also assign a value to a variable when you declare it by using the Assignment operator. The following are variable declarators in Crystal syntax.
Usage
- Local BooleanVar x
- Local NumberVar x
- Local CurrencyVar x
- Local DateVar x
- Local TimeVar x
- Local DateTimeVar x
- Local StringVar x
- Local NumberVar range x
- Local CurrencyVar range x
- Local DateVar range x
- Local TimeVar range x
- Local DateTimeVar range x
- Local StringVar range x
- Local BooleanVar array x
- Local NumberVar array x
- Local CurrencyVar array x
- Local DateVar array x
- Local TimeVar array x
- Local DateTimeVar array x
- Local StringVar array x
- Local NumberVar range array x
- Local CurrencyVar range array x
- Local DateVar range array x
- Local TimeVar range array x
- Local DateTimeVar range array x
- Local StringVar range array x.
Declares a local variable x that can hold data of a type corresponding to the variable declarator used.
Local variables retain their value only for the given evaluation of the formula in which they occur.
Comments
- A variable declarator must be used to declare a variable before the variable can be used in a formula.
- Local specifies a variable with local scope. You can use the keywords Global, and Shared instead of Local to specify different scopes. You can also omit the scope keyword and start the variable declaration with the type name. This is the same as declaring a Global variable. See Variable Scope (Crystal syntax) and Variable scopes for Crystal syntax.
Related topics
Variable declarations (Crystal syntax)
Declaring array variables (Crystal syntax) (Crystal syntax)